package d.n.d.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the user database table.
 * 
 */
@Entity
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String userName;

	private String password;

	private String userRole;

	//bi-directional many-to-one association to Transaction
	@OneToMany(mappedBy="userAdmin")
	private List<Transaction> transactionUserAdmin;

	//bi-directional many-to-one association to Transaction
	@OneToMany(mappedBy="userSupport")
	private List<Transaction> transactionUserSupport;

	public User() {
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserRole() {
		return this.userRole;
	}

	public void setUserRole(String userRole) {
		this.userRole = userRole;
	}

	public List<Transaction> getTransactionUserAdmin() {
		return this.transactionUserAdmin;
	}

	public void setTransactionUserAdmin(List<Transaction> transactionUserAdmin) {
		this.transactionUserAdmin = transactionUserAdmin;
	}

	public Transaction addTransactionUserAdmin(Transaction transactionUserAdmin) {
		getTransactionUserAdmin().add(transactionUserAdmin);
		transactionUserAdmin.setUserAdmin(this);

		return transactionUserAdmin;
	}

	public Transaction removeTransactionUserAdmin(Transaction transactionUserAdmin) {
		getTransactionUserAdmin().remove(transactionUserAdmin);
		transactionUserAdmin.setUserAdmin(null);

		return transactionUserAdmin;
	}

	public List<Transaction> getTransactionUserSupport() {
		return this.transactionUserSupport;
	}

	public void setTransactionUserSupport(List<Transaction> transactionUserSupport) {
		this.transactionUserSupport = transactionUserSupport;
	}

	public Transaction addTransactionUserSupport(Transaction transactionUserSupport) {
		getTransactionUserSupport().add(transactionUserSupport);
		transactionUserSupport.setUserSupport(this);

		return transactionUserSupport;
	}

	public Transaction removeTransactionUserSupport(Transaction transactionUserSupport) {
		getTransactionUserSupport().remove(transactionUserSupport);
		transactionUserSupport.setUserSupport(null);

		return transactionUserSupport;
	}

}